home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-2.dms / in.adf / MUIClass.Lha / Demo / Demo2 / HP.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-17  |  2.1 KB  |  70 lines

  1. //
  2. //    c 1996 Thomas Wilhelmi
  3. //
  4. //
  5. // Address : Taunusstrasse 14
  6. //           61138 Niederdorfelden
  7. //           Germany
  8. //
  9. //  E-Mail : willi@twi.rhein-main.de
  10. //
  11. //   Phone : +49 (0)6101 531060
  12. //   Fax   : +49 (0)6101 531061
  13. //
  14.  
  15. //
  16. // Dieses Demo-Programm öfnnet ein kleines Fenster
  17. // mit drei Buttons. Wenn das Close-Gadget gedrückt
  18. // wird, wird es wieder geschloßen.
  19. // Hier wird auch demonstriert wie einfach ein eigener
  20. // Dispatcher mit eigenen Methoden für die einzelnen
  21. // Objekte realisiert werden kann.
  22. //
  23.  
  24. #include <classes/twimui/application.h>
  25. #include <storm/libbase.h>
  26. #include <iostream.h>
  27. #include "Class.h"
  28.  
  29. LibBaseC MUIMasterBase(MUIMASTER_NAME,MUIMASTER_VMIN,FALSE);
  30.  
  31. void main()
  32.     {
  33.     if (LibBaseC::areAllOpen())
  34.         {
  35.         try
  36.             {
  37.             TWiWin Win();
  38.             MUIApplication App(
  39.                 MUIA_Application_Title,       "TWiDVI",
  40.                 MUIA_Application_Version,     "$VER: TWiDVI 1.0 (12.01.96)",
  41.                 MUIA_Application_Copyright,   "c1996, Thomas Wilhelmi",
  42.                 MUIA_Application_Author,      "Thomas Wilhelmi",
  43.                 MUIA_Application_Description, "Little GUI for DVIPrint",
  44.                 MUIA_Application_Base,        "TWIDVI",
  45.                 MUIA_Application_SingleTask,  TRUE,
  46.                 SubWindow,                    (Object *)Win,
  47.                 TAG_DONE);
  48.             Win.Notify(MUIA_Window_CloseRequest, TRUE, App, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  49.             App.Notify(MUIA_Application_DoubleStart, TRUE, App, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  50.             Win.Open(TRUE);
  51.             App.Loop();
  52.             Win.Open(FALSE);
  53.             }
  54.         catch (MUIErrorX(m))
  55.             {
  56.             cout << "MUIErrorX typ: " << m.typ() << endl;
  57.             }
  58.         catch (TWiMemX(x))
  59.             {
  60.             cout << "TWiMemX size: " << x.size() << endl;
  61.             }
  62.         catch (...)
  63.             {
  64.             cout << "unbekannte Exception" << endl;
  65.             }
  66.         }
  67.       else
  68.         cout << "Problem mit Library" << endl;
  69.     };
  70.